---
title: Microsoft Teams
description: 阅读、撰写和创建消息
---

import { BlockInfoCard } from "@/components/ui/block-info-card"

<BlockInfoCard 
  type="microsoft_teams"
  color="#E0E0E0"
  icon={true}
  iconSvg={`<svg className="block-icon"  xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2228.833 2073.333'>
      <path
        fill='#5059C9'
        d='M1554.637,777.5h575.713c54.391,0,98.483,44.092,98.483,98.483c0,0,0,0,0,0v524.398 c0,199.901-162.051,361.952-361.952,361.952h0h-1.711c-199.901,0.028-361.975-162-362.004-361.901c0-0.017,0-0.034,0-0.052V828.971 C1503.167,800.544,1526.211,777.5,1554.637,777.5L1554.637,777.5z'
      />
      <circle fill='#5059C9' cx='1943.75' cy='440.583' r='233.25' />
      <circle fill='#7B83EB' cx='1218.083' cy='336.917' r='336.917' />
      <path
        fill='#7B83EB'
        d='M1667.323,777.5H717.01c-53.743,1.33-96.257,45.931-95.01,99.676v598.105 c-7.505,322.519,247.657,590.16,570.167,598.053c322.51-7.893,577.671-275.534,570.167-598.053V877.176 C1763.579,823.431,1721.066,778.83,1667.323,777.5z'
      />
      <path
        opacity='.1'
        d='M1244,777.5v838.145c-0.258,38.435-23.549,72.964-59.09,87.598 c-11.316,4.787-23.478,7.254-35.765,7.257H667.613c-6.738-17.105-12.958-34.21-18.142-51.833 c-18.144-59.477-27.402-121.307-27.472-183.49V877.02c-1.246-53.659,41.198-98.19,94.855-99.52H1244z'
      />
      <path
        opacity='.2'
        d='M1192.167,777.5v889.978c-0.002,12.287-2.47,24.449-7.257,35.765 c-14.634,35.541-49.163,58.833-87.598,59.09H691.975c-8.812-17.105-17.105-34.21-24.362-51.833 c-7.257-17.623-12.958-34.21-18.142-51.833c-18.144-59.476-27.402-121.307-27.472-183.49V877.02 c-1.246-53.659,41.198-98.19,94.855-99.52H1192.167z'
      />
      <path
        opacity='.2'
        d='M1192.167,777.5v786.312c-0.395,52.223-42.632,94.46-94.855,94.855h-447.84 c-18.144-59.476-27.402-121.307-27.472-183.49V877.02c-1.246-53.659,41.198-98.19,94.855-99.52H1192.167z'
      />
      <path
        opacity='.2'
        d='M1140.333,777.5v786.312c-0.395,52.223-42.632,94.46-94.855,94.855H649.472 c-18.144-59.476-27.402-121.307-27.472-183.49V877.02c-1.246-53.659,41.198-98.19,94.855-99.52H1140.333z'
      />
      <path
        opacity='.1'
        d='M1244,509.522v163.275c-8.812,0.518-17.105,1.037-25.917,1.037 c-8.812,0-17.105-0.518-25.917-1.037c-17.496-1.161-34.848-3.937-51.833-8.293c-104.963-24.857-191.679-98.469-233.25-198.003 c-7.153-16.715-12.706-34.071-16.587-51.833h258.648C1201.449,414.866,1243.801,457.217,1244,509.522z'
      />
      <path
        opacity='.2'
        d='M1192.167,561.355v111.442c-17.496-1.161-34.848-3.937-51.833-8.293 c-104.963-24.857-191.679-98.469-233.25-198.003h190.228C1149.616,466.699,1191.968,509.051,1192.167,561.355z'
      />
      <path
        opacity='.2'
        d='M1192.167,561.355v111.442c-17.496-1.161-34.848-3.937-51.833-8.293 c-104.963-24.857-191.679-98.469-233.25-198.003h190.228C1149.616,466.699,1191.968,509.051,1192.167,561.355z'
      />
      <path
        opacity='.2'
        d='M1140.333,561.355v103.148c-104.963-24.857-191.679-98.469-233.25-198.003 h138.395C1097.783,466.699,1140.134,509.051,1140.333,561.355z'
      />
      <linearGradient
        id='a'
        gradientUnits='userSpaceOnUse'
        x1='198.099'
        y1='1683.0726'
        x2='942.2344'
        y2='394.2607'
        gradientTransform='matrix(1 0 0 -1 0 2075.3333)'
      >
        <stop offset='0' stopColor='#5a62c3' />
        <stop offset='.5' stopColor='#4d55bd' />
        <stop offset='1' stopColor='#3940ab' />
        <stop offset='0' stopColor='#5a62c3' />
        <stop offset='.5' stopColor='#4d55bd' />
        <stop offset='1' stopColor='#3940ab' />
      </linearGradient>
      <path
        fill='url(#a)'
        d='M95.01,466.5h950.312c52.473,0,95.01,42.538,95.01,95.01v950.312c0,52.473-42.538,95.01-95.01,95.01 H95.01c-52.473,0-95.01-42.538-95.01-95.01V561.51C0,509.038,42.538,466.5,95.01,466.5z'
      />
      <path
        fill='#FFF'
        d='M820.211,828.193H630.241v517.297H509.211V828.193H320.123V727.844h500.088V828.193z'
      />
    </svg>`}
/>

{/* MANUAL-CONTENT-START:intro */}
[Microsoft Teams](https://teams.microsoft.com) 是一个强大的通信和协作平台，用户可以在团队和组织内进行实时消息、会议和内容共享。作为 Microsoft 生产力生态系统的一部分，Microsoft Teams 提供与 Office 365 无缝集成的聊天功能，用户可以发布消息、协调工作，并在设备和工作流之间保持连接。

使用 Microsoft Teams，您可以：

- **发送和接收消息**：通过聊天线程即时与个人或群组沟通  
- **实时协作**：在频道和聊天中共享更新和信息  
- **组织对话**：通过线程式讨论和持久聊天记录保持上下文  
- **共享文件和内容**：直接在聊天中附加和查看文档、图片和链接  
- **与 Microsoft 365 集成**：无缝连接 Outlook、SharePoint、OneDrive 等  
- **跨设备访问**：在桌面、网页和移动设备上使用 Teams，并同步云端对话  
- **安全通信**：利用企业级安全性和合规功能

在 Sim 中，Microsoft Teams 集成使您的代理可以通过编程方式直接与聊天消息交互。这为强大的自动化场景提供了可能，例如发送更新、发布警报、协调任务以及实时响应对话。您的代理可以向聊天或频道中写入新消息，根据工作流数据更新内容，并在协作发生的地方与用户互动。通过将 Sim 与 Microsoft Teams 集成，您可以弥合智能工作流与团队沟通之间的差距——帮助您的代理简化协作、自动化通信任务，并使您的团队保持一致。
{/* MANUAL-CONTENT-END */}

## 使用说明

将 Microsoft Teams 集成到工作流程中。可以读取和发送聊天消息，以及读取和发送频道消息。需要 OAuth 授权。可在触发模式下使用，当消息发送到聊天或频道时触发工作流程。

## 工具

### `microsoft_teams_read_chat`

从 Microsoft Teams 聊天中读取内容

#### 输入

| 参数 | 类型 | 必需 | 描述 |
| --------- | ---- | -------- | ----------- |
| `chatId` | string | 是 | 要读取的聊天 ID |
| `includeAttachments` | boolean | 否 | 下载并将消息附件（托管内容）包含到存储中 |

#### 输出

| 参数 | 类型 | 描述 |
| --------- | ---- | ----------- |
| `success` | boolean | Teams 聊天读取操作成功状态 |
| `messageCount` | number | 从聊天中检索到的消息数量 |
| `chatId` | string | 读取的聊天 ID |
| `messages` | array | 聊天消息对象的数组 |
| `attachmentCount` | number | 找到的附件总数 |
| `attachmentTypes` | array | 找到的附件类型 |
| `content` | string | 聊天消息的格式化内容 |
| `attachments` | file[] | 为方便起见上传的附件（扁平化） |

### `microsoft_teams_write_chat`

在 Microsoft Teams 聊天中撰写或更新内容

#### 输入

| 参数 | 类型 | 必需 | 描述 |
| --------- | ---- | -------- | ----------- |
| `chatId` | string | 是 | 要写入的聊天 ID |
| `content` | string | 是 | 要写入消息的内容 |
| `files` | file[] | 否 | 要附加到消息的文件 |

#### 输出

| 参数 | 类型 | 描述 |
| --------- | ---- | ----------- |
| `success` | boolean | Teams 聊天消息发送成功状态 |
| `messageId` | string | 已发送消息的唯一标识符 |
| `chatId` | string | 发送消息的聊天 ID |
| `createdTime` | string | 创建消息的时间戳 |
| `url` | string | 消息的网页 URL |
| `updatedContent` | boolean | 内容是否成功更新 |

### `microsoft_teams_read_channel`

从 Microsoft Teams 频道读取内容

#### 输入

| 参数 | 类型 | 必需 | 描述 |
| --------- | ---- | -------- | ----------- |
| `teamId` | string | 是 | 要读取的团队 ID |
| `channelId` | string | 是 | 要读取的频道 ID |
| `includeAttachments` | boolean | 否 | 下载并将消息附件（托管内容）包含到存储中 |

#### 输出

| 参数 | 类型 | 描述 |
| --------- | ---- | ----------- |
| `success` | boolean | Teams 频道读取操作成功状态 |
| `messageCount` | number | 从频道中检索到的消息数量 |
| `teamId` | string | 读取的团队 ID |
| `channelId` | string | 读取的频道 ID |
| `messages` | array | 频道消息对象的数组 |
| `attachmentCount` | number | 找到的附件总数 |
| `attachmentTypes` | array | 找到的附件类型 |
| `content` | string | 频道消息的格式化内容 |
| `attachments` | file[] | 为方便起见上传的附件（扁平化） |

### `microsoft_teams_write_channel`

向 Microsoft Teams 频道编写或发送消息

#### 输入

| 参数 | 类型 | 必需 | 描述 |
| --------- | ---- | -------- | ----------- |
| `teamId` | string | 是 | 要写入的团队 ID |
| `channelId` | string | 是 | 要写入的频道 ID |
| `content` | string | 是 | 要写入频道的内容 |
| `files` | file[] | 否 | 要附加到消息的文件 |

#### 输出

| 参数 | 类型 | 描述 |
| --------- | ---- | ----------- |
| `success` | boolean | Teams 频道消息发送成功状态 |
| `messageId` | string | 已发送消息的唯一标识符 |
| `teamId` | string | 发送消息的团队 ID |
| `channelId` | string | 发送消息的频道 ID |
| `createdTime` | string | 消息创建的时间戳 |
| `url` | string | 消息的网页 URL |
| `updatedContent` | boolean | 内容是否成功更新 |

## 注意事项

- 类别：`tools`
- 类型：`microsoft_teams`
